home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: bath.ac.uk!bsmail!talisker!nathan
- From: nathan@pact.srf.ac.uk (Nathan Sidwell)
- Subject: Re: Logical exclusive-or
- Message-ID: <DMGD6x.73C@uns.bris.ac.uk>
- Sender: usenet@uns.bris.ac.uk (Usenet news owner)
- Nntp-Posting-Host: talisker.pact.srf.ac.uk
- Organization: Inmos
- X-Newsreader: TIN [version 1.2 PL2]
- References: <4f6lrq$bcr@lastactionhero.rs.itd.umich.edu>
- Date: Thu, 8 Feb 1996 10:30:33 GMT
-
- David Miller (davidm@umich.edu) wrote:
- : Is there a good reason why C doesn't have a logical exclusive-or
- : operator? A look at the precedence hierarchy suggests an obvious
- : symbol and precedence for such an operator:
-
- : The logical exclusive or would be represented by ^^ and have
- : precedence higher than || but lower than && . If C requires machines
- : to be able to implement bitwise XOR, then it would seem reasonable to
- : require the logical operator also.
-
- Originally C did not have && and || operators, the & and | operators
- were used, hence &, | and ^ have lower precedence than the relation
- operators. Then a short circuiting operation was required and && and ||
- were born. A ^^ was not created because it would not have the short
- circuiting property.
-
- For more information see http://www.lysator.liu.se/c/
- in particular http://www.lysator.liu.se/c/chistory.ps and
- http://www.lysator.liu.se/c/dmr-on-or.html#main
-
- nathan
-
- --
- Nathan Sidwell Holder of the Xmris home page
- Chameleon Architecture Group at SGS-Thomson, formerly Inmos
- http://www.pact.srf.ac.uk/~nathan/ Tel 0117 9707182
- nathan@inmos.co.uk or nathan@bristol.st.com or nathan@pact.srf.ac.uk
-